- hosts: localhost
  tasks:
    - name: Install graphic editors
      become: yes
      package:
        name:
          - gimp
          - krita
        state: present
    - name: Install graphic tweaks stuff
      become: yes
      package:
        name:
          - papirus-icon-theme
        state: present
    - name: Install gnome tweaks
      become: yes
      package:
        name:
          - gnome-tweaks
          - gnome-extensions-app
          - gnome-shell-extension-appindicator
        state: present
    - name: Install chkrootkit
      become: yes
      package:
        name: chkrootkit
        state: present
    - name: Install playbook requirements
      become: yes
      package:
        name:
          - python3-psutil
          - dconf
          - dbus-tools
          - dbus-daemon
          - rcm
          - git
        state: present
    - name: Install neovim
      become: yes
      package:
        name: neovim
        state: present

    # configuration
    - name: Configure available keyboard layouts in Gnome
      community.general.dconf:
        key: "/org/gnome/desktop/input-sources/sources"
        value: "[('xkb', 'us'), ('xkb', 'ru')]"
        state: present
    - name: Enable extensions
      dconf:
        key: "/org/gnome/shell/enabled-extensions"
        value: "['appindicatorsupport@rgcjonas.gmail.com']"
    - name: Enable tap to click
      dconf:
        key: "/org/gnome/desktop/peripherals/touchpad/tap-to-click"
        value: "true"
    - name: Enable papirus icon theme
      dconf:
        key: "/org/gnome/desktop/interface/icon-theme"
        value: Papirus-Dark

    # flatpak
    - name: Enable Flathub repository
      become: yes
      command: flatpak remote-add --if-not-exists flathub https://flathub.org/repo/flathub.flatpakrepo
    - name: Install Telegram
      become: yes
      command: flatpak install --assumeyes flathub org.telegram.desktop
    - name: Install Discord
      become: yes
      command: flatpak install --assumeyes flathub com.discordapp.Discord
    - name: Install OBS
      become: yes
      command: flatpak install --assumeyes flathub com.obsproject.Studio
    - name: Install KDEnlive
      become: yes
      command: flatpak install --assumeyes flathub org.kde.kdenlive
    - name: Install Foliate
      become: yes
      command: flatpak install --assumeyes flathub com.github.johnfactotum.Foliate

    # dotfiles
    - name: Clone dotfiles git repo
      git:
        repo: https://notabug.org/avishu/dotfiles
        dest: $HOME/.dotfiles
    - name: Create symlinks to dotfiles
      become: yes
      command: rcup config/nvim/init.vim
